﻿using UnityEngine;
using System.Collections;

[RequireComponent(typeof(UIToggle))]
public class EPToggle : MonoBehaviour
{
	public int toggleIndex = -1;

	GameObject on;
	GameObject off;
	
	void Awake()
	{
		off = transform.FindChild("off").gameObject;
		on = transform.FindChild("on").gameObject;
	}

	public void OnChangeProcess(bool stateValue)
	{
		if (stateValue)
		{
			on.SetActive(true);
			off.SetActive(false);
		}
		else
		{
			on.SetActive(false);
			off.SetActive(true);
		}
	}
}
